<!--
 * @Description: 
 * @Author: dh
 * @Date: 2022-01-24 15:18:18
 * @LastEditors: dh
 * @LastEditTime: 2022-01-24 15:18:18
-->
<script>
	var svg = document.getElementsByTagName('svg')[0];
	var path = svg.getElementsByTagName('path')[0];

	// .getTotalLength() --- 获取路径总长度、
	var len = path.getTotalLength(); // 返回：300

	// .getPointAtLength(x) --- 获取路径某一点的坐标，x == 从起点开始的长度、
	var SVGPoint = path.getPointAtLength(50); // 返回对象：SVGPoint {x: 100, y: 25}

	console.log(len, SVGPoint);
</script>
